<?php
/**
 * 类说明 :
 * User: 刘明昆
 * Date: 2019-1-28
 * Time: 14:48
 */

function json($code,$message="",$data=array()){
    $result=array(
        'code'=>$code,
        'message'=>$message,
        'data'=>$data
    );
    //输出json
    echo json_encode($result);
    exit;
}

function jsonlist($rows=array(),$total){
    $result=array(
        'rows'=>$rows,
        'total'=>$total
    );
    //输出json
    echo trim(json_encode($result),',');
    exit;
}

function msgtxt($code,$message=""){
    $result=array(
        'code'=>$code,
        'message'=>$message
    );
    //输出json
    echo json_encode($result);
    exit;
}

function showmsgtxt($message){
    //输出json
    echo $message;
    exit;
}